package org.example.hansp.genetic.custom_generic;

import java.util.ArrayList;

@SuppressWarnings({"all"})
public class CustomMethodGeneric {
    public static void main(String[] args) {
        A a = new A();
        a.Af1("lim", 100);
        B b = new B();
        b.Bf1(new ArrayList<>(), "hello");

    }
}

class A {
    private int x;

    public <T, R> void Af1(T t, R r) {
        System.out.println(t.getClass().getName());
        System.out.println(r.getClass().getName());
    }

}

class B<U, V> {
    private U u;
    private V v;

    public <W, X> void Bf1(W w, X x) {
        System.out.println(w.getClass().getName());
        System.out.println(x.getClass().getName());
    }

    public <W, X> void Bf2(W w, X x, U u, V v) {
        System.out.println(w.getClass().getName());
        System.out.println(x.getClass().getName());
        System.out.println(u.getClass().getName());
        System.out.println(v.getClass().getName());
    }

    //不是泛型方法，只是使用了类声明的泛型
    public void Bf3(U u) {
        System.out.println(u.getClass().getName());
    }

}
